package jmind.asteroidea.core.reducer;

/**
 * description: 返回第一个不为null的结果
 *
 * @author weibo.xie
 * @date:2022/7/11 下午2:36
 */
public class FirstNonNullReducer<R> extends Reducer<R>{

    private R  result ;

    @Override
    public boolean isBreak(String tag, R result) {
        this.result=result;
        return result!=null;
    }

    @Override
    public R reduce() {
        return result;
    }
}
